package com.carsite.service.impl;

import java.util.List;

import com.carsite.dao.RoleDao;
import com.carsite.model.QueryMap;
import com.carsite.model.Role;
import com.carsite.service.RoleManager;


/**
 * Implementation of RoleManager interface.</p>
 * 
 * <p><a href="RoleManagerImpl.java.html"><i>View Source</i></a></p>
 * 
 * @author <a href="mailto:dan@getrolling.com">Dan Kibler</a>
 */
public class RoleManagerImpl extends BaseManager implements RoleManager {
    private RoleDao dao;

    public void setRoleDao(RoleDao dao) {
        this.dao = dao;
    }

    public List getRoles(Role role) {
        return dao.getRoles(role);
    }

    public Role getRole(String rolename) {
        return dao.getRoleByName(rolename);
    }

    public void saveRole(Role role) {
        dao.saveRole(role);
    }

    public void removeRole(String rolename) {
        dao.removeRole(rolename);
    }
    
    
    
    //added
    public Role getRole(Long  roleId){
    	 return dao.getRoleById(roleId);
    }
    
    public void removeRole(Long id){
    	dao.removeRole(id );
    }
    
    public List getRoleByCondition(String roleCondition){
    	return dao.getRolesByCondition(roleCondition );
    }

	/* (non-Javadoc)
	 * @see com.clothserver.service.RoleManager#getRolesByLevel(java.lang.String)
	 */
	public List getRolesByLevel(String level) {
		return dao.getRolesByLevel(level);
	}

	/* (non-Javadoc)
	 * @see com.clothserver.service.RoleManager#getRoleByConditions(com.clothserver.model.QueryMap)
	 */
	public List getRoleByConditions(QueryMap queryMap) {
		return dao.getRoleByConditions(queryMap);
	}
    
    
   
}
